<?php

namespace app\common\model;

use app\admin\model\shopro\data\Richtext;
use think\Model;

/**
 *
 */
class Msg extends Model
{

    // 表名
    protected $name = 'msg';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = '';
    // 追加属性
    protected $append = [
    ];

    public static function addMsg($user_ids, $title, $detail, $type_id = 1)
    {
        // 发送一条默认的系统消息
        $res = self::create([
            'user_ids' => $user_ids,
            'title' => $title,
            'detail' => $detail,
            'type_id' => 1,
            'oper_id' => 1,
        ]);
    }
}
